import { CommonResponse } from '../typings';
// 对响应体的封装
export function responseWrapper(
  data: any,
  isFail: boolean = false,
): CommonResponse {
  return {
    code: isFail ? 1 : 0,
    data: data,
    message: !isFail ? '成功' : data.message ? data.message : '失败',
  };
}
